import Vue from 'vue'
import Router from 'vue-router'
import plane from '@/components/plane'
import hi from '@/components/hi'
// import girl from '@/components/girl'

Vue.use(Router)
const routerRePush = Router.prototype.push
Router.prototype.push = function (location) {
  return routerRePush.call(this, location).catch(error => error)
}
export default new Router({
  routes: [

    {
      path: '/',
      name: 'hi',
      component: hi
    },
    {
      path: '/plane',
      name: 'plane',
      component: plane
    },
    {
      path: '/girl',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/girl.vue")
    },
    {
      path: '/lover',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/lover.vue")
    },
    {
      path: '/editLover',
      name: 'editLover',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/editLover.vue")
    },
    {
      path: '/test',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/test.vue")
    },
    {
      path: '/event',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/event.vue")
    },
    {
      path: '/todo',
//对比上面的例子，此法更加简单一些
      component: ()=>import("../components/todo.vue")
    },
  ]
})
